//
//  videoTitleView.m
//  IFengNews
//
//  Created by lanou3g on 16/3/8.
//  Copyright © 2016年 徐强. All rights reserved.
//

#import "videoTitleView.h"
#import "UIImageView+WebCache.h"
@implementation videoTitleView
- (instancetype)initWithFrame:(CGRect )frame ModelArr:(NSMutableArray<videoTitleModel *>*)arr
{
    self = [super initWithFrame:frame];
    if (self) {

        for (int i = 0 ; i < arr.count; i++)
        {
            UIImageView *imV = [[UIImageView alloc]initWithFrame:CGRectMake(10 + self.frame.size.width * i / 4.0, 5, self.frame.size.width / 4.0 - 20, self.frame.size.height * 2 / 3.0 -5)];
            [imV sd_setImageWithURL:[NSURL URLWithString:arr[i].imgsrc]];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(self.frame.size.width * i / 4.0, self.frame.size.height * 2 / 3.0, self.frame.size.width / 4.0, self.frame.size.height * 1 / 3.0)];
            label.text = arr[i].title;
            label.textAlignment = NSTextAlignmentCenter;
            [self addSubview:imV];
            [self addSubview:label];
        } 
    }
    return self;
}
@end
